<include file="__THEME__/header" />


<script type="text/javascript" src="../Public/Js/Common.js"></script>
<script type="text/javascript" src="../Public/Js/index.js"></script>
<link  href="../Public/group.css" rel="stylesheet" type="text/css"/>
<script>
    function getstrlen(chars) {

        chars = chars.replace(/^\s+|\s+$/g, "");
        return chars.replace(/[^\x00-\xff]/g, "xx").length;
    }
    function checkform(v_form) {
        if (getstrlen(v_form.title.value) == 0) {
            v_form.title.focus();
            alert('标题不能为空');
            return false;
        }
        if (getstrlen(v_form.title.value) > 90) {
            v_form.title.focus();

            alert('标题内容过长');
            return false;
        }

        if (gKE.util.getData('icontent') == '') {
            alert('内容不能为空');
            return false;
        }
        return true;
    }
</script>

</head>

<body>

    <div class="content"><!-- 内容 begin  -->

        <!-- 用户组件列表 begin -->
        <include file="__THEME__/apps" />      
        <!-- 用户组件列表 end -->

        <div class="main"> <!-- 右侧内容 begin  -->
            <div class=page_title> <!-- page_title begin -->


                <div class="left" style="width:583px;">
                    <h2 id="group_name"><a href="__APP__/Group/index/gid/{$myAllGroup[0]['id']}">{$myAllGroup[0]['name']}</a> &gt; 发表话题</h2>

                </div>

                <div class="left alR lh30" style="width:170px;">
                    <a href="JavaScript:window.history.back()">&lt;&lt;返回上一页</a></div>
                <div class="c"></div>
            </div><!-- page_title end -->
            <!-- 切换标签 end  -->
            <div class="groupBox">
                <div class="boxL" style="width:100%;">
                    <div class="box1">
                        <h3>发表新话题</h3>
                        <form method="post" action="__APP__/Topic/doAdd/" onSubmit="return checkform(this);">
                            <ul class="pt10">
                                <li class="li">
                                    <div class="lh25 alR left" style="width:10%;padding:5px 0;"><strong>选择群组：</strong></div>
                                    <div class="left" style="width:90%;padding:5px 0;">
                                        <label>
                                            <select name="gid" id="select_group" onchange="doSwitch();">
                                                <volist name="myAllGroup" id="group" >
                                                    <option value="{$group['id']}">{$group['name']}</option>
                                                </volist>
                                            </select>
                                        </label>
                                        分栏：<select name="catalog">
                                            <option value="0">请选择分栏</option>
                                            <volist name="allCatalog" id="catalog" >
                                                <option value="{$catalog['catalog_id']}">{$catalog['catalog_name']}</option>
                                            </volist>
                                        </select>
                                    </div>
                                </li>
                                <li class="li">
                                    <div class="lh35 alR left" style="width:10%"><strong>标题：</strong></div>
                                    <div class="left" style="width:90%">

                                        <input name="title" class="Text" style="padding: 8px; width: 70%;" onBlur="this.className = 'Text'" onFocus="this.className = 'Text1'" type="text"/>

                                    </div>
                                </li>
                                <li class="li pt10">
                                    <div class="left alR lh30" style="width:10%"><strong>内容：</strong></div>
                                    <div class="left" style="width:90%">
                                        {:W("Edit",array('smileList'=>$smileList,'smilePath'=>$smilePath,'rows'=>20,'cols'=>20))}
                                    </div>
                                </li>
                                <li class="li">
                                    <div class="lh35 alR left" style="width:10%"><strong>附件：</strong></div>
                                    <div class="left" style="width:90%; padding-top:5px;">
                                        {:W( 'UploadAttach',array( 'uid'=>$mid , 'type'=>'group_topic' , 'callback'=>'attach_upload_success') )}
                                    </div>
                                </li>
                                <li class="li">
                                    <div style="width:10%" class="left">&nbsp;</div>
                                    <div class="left" style="width:90%">
                                        <input type="hidden" name="addsubmit" value="do" >
                                        <input name="button" type="submit" class="btn_b mt5" id="button" value="发表话题" />
                                    </div>
                                </li>
                            </ul>
                        </form>    
                    </div>
                </div>
                <!-- end  -->
            </div>  </div><!-- 右侧内容 end  -->
        <div class="c"></div>
    </div><!-- 内容 end -->
<include file="__THEME__/footer" />
</body>
</html>
